![]() |
HandleControlKey |
||||
Header: | Controls.h | Carbon status: | Supported | |
Sends a keyboard event to a control with keyboard focus.
SInt16 HandleControlKey ( ControlRef inControl, SInt16 inKeyCode, SInt16 inCharCode, EventModifiers inModifiers );
A handle to the control that currently has keyboard focus.
The virtual key code, derived from the event structure. This value represents the key pressed or released by the user. It is always the same for a specific physical key on a particular keyboard regardless of which modifier keys were also pressed.
A character, derived from the event structure. The value that is generated depends on the virtual key code, the state of the modifier keys, and the current 'KCHR' resource.
Information from the modifiers field of the event structure specifying the state of the modifier keys and the mouse button at the time the event was posted.
The part code that was hit during the keyboard event; see
If you have determined that a keyboard event has occurred in a given window, before calling the HandleControlKey function, call GetKeyboardFocus to get the handle to the control that currently has keyboard focus. The HandleControlKey function passes the values specified in its inKeyCode, inCharCode, and inModifiers parameters to control definition functions that set the kControlSupportsFocus feature bit.
Available with Appearance Manager 1.0 and later.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)